using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using PccCommonForC;
public partial class Manager_Topic_AddTopic : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["AdminUserID"] == null)
        {
            Response.Write("<script language=javascript>alert('Time is out.');window.open('../Default.aspx','_top');</script>");
            return;
        }
    }
    protected void btnCancel_Click(object sender, EventArgs e)
    {
        ReturnPage();
    }

    private void ReturnPage()
    {
        Response.Redirect("Topic.aspx?CodeID=" + Request.QueryString["CodeID"]);
    }
    protected void btnAdd_Catalogue_Click(object sender, EventArgs e)
    {
        PccMsg msg = new PccMsg();
        string strShowMK = "N";
        if (chk_state.Checked == true)
            strShowMK = "Y";

        msg.CreateFirstNode("TopicName", txtTenChuDe.Text.ToString());
        msg.CreateFirstNode("ShowMK", strShowMK);
        msg.CreateFirstNode("Status", "N");
        msg.CreateFirstNode("UpdID",Session["AdminUserID"].ToString());

        clsWebShop cls = new clsWebShop();
        cls.Ins_Topic(msg.GetXmlStr.ToString());
        txtTenChuDe.Text = "";
        txtTenChuDe.Focus();
        ClientScript.RegisterClientScriptBlock(this.GetType(), "", "<script>alert('Success!!!')</script>");
        ReturnPage();
 
    }
}
